import { ComponentConfig } from '@/components/editor/type';
import { inputConfig } from './questionInput';
import { paragraphConfig } from './questionParagraph';
import { titleConfig } from './questionTitle';
import { infoConfig } from './questionInfo';
import { textAreaConfig } from './questionTextArea';
import { radioConfig } from './questionRadio';
import { checkBoxConfig } from './questionCheckBox';

export * from './type';

type ConfigGroup = {
  groupName: string;
  components: ComponentConfig[];
  groupId: string;
};

export const componentConfigList: ComponentConfig[] = [
  inputConfig,
  titleConfig,
  paragraphConfig,
  infoConfig,
  textAreaConfig,
  radioConfig,
  checkBoxConfig,
];

export const componentConfigGroup: ConfigGroup[] = [
  {
    groupId: 'text',
    groupName: '文本显示',
    components: [infoConfig, titleConfig, paragraphConfig],
  },
  {
    groupId: 'input',
    groupName: '用户输入',
    components: [inputConfig, textAreaConfig],
  },
  {
    groupId: 'choose',
    groupName: '用户选择',
    components: [radioConfig, checkBoxConfig],
  },
];
